<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta name="keywords" content="" />
    <meta name="description" content="">
    <include file="public@head" />
</head>

<body class="body-white">
    <include file="public@nav" />

    <div class="container tc-main">
        <section class="form_popup w-100">
            <div class="signup_form" id="signup_form">
                <div class="hd-lg">
                    <img src="/themes/simpleboot3/Public/assets/images/logo.png" alt="" class="img-fluid">
                    <span>注册您的Photo账户</span>
                </div>
                <div class="user-account-pr">
                    <form action="{:url('user/Register/doRegister')}" class="form-horizontal js-ajax-form" role="form"
                        method="POST">
                        <div class="row">
                            <div class="col-md-8 col-8">
                                <input type="email" name="username" class="form-control" required id="username"
                                    placeholder="邮箱">
                            </div>
                            <div class="input-sec col-md-4 col-4">
                                <button type="button" class="btn btn-outline-info" required
                                    id="send-email-code">获取验证码</button>
                            </div>
                        </div>
                        <div class="input-sec">
                            <input type="text" name="code" placeholder="验证码" required>
                        </div>

                        <div class="input-sec">
                            <input type="Password" name="password" placeholder="密码" required>
                        </div>
                        <div class="input-sec">
                            <input type="password" name="confirm-password" placeholder="确认密码" required>
                        </div>

                        <div class="row">
                            <div class="col-md-8 col-8">
                                <input type="text" name="captcha" class="form-control " placeholder="输入验证码" required>
                            </div>
                            <div class="input-sec col-md-4 col-4">
                                <captcha width="110" height="36" font-size="16"
                                    style="margin-bottom:0px !important ;" />
                            </div>
                        </div>
                        <div class="input-sec">
                            <input type="text" name="user_nickname" placeholder="给自己起个名字~" required>
                        </div>
                        <div class="input-sec">
                            <textarea class="form-control" name="description" rows="3"
                                placeholder="介绍一下自己吧~"></textarea>
                        </div>
                        <div class="chekbox-lg">
                            <ul>
                                <li>
                                    <label>
                                        <input type="radio" name="sex" checked value="1">
                                        <b class="checkmark"> </b>
                                        <span>男</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input type="radio" name="sex" value="2">
                                        <b class="checkmark"> </b>
                                        <span>女</span>
                                    </label>
                                </li>
                            </ul>
                        </div>
                        <div class="input-sec mb-0">
                            <button type="submit" class="btn  js-ajax-submit">注册</button>
                        </div>
                    </form>
                </div>
                <!-- <div class="fr-ps py-3">
                    <h1>已有账号？<a href="{:cmf_url('user/Login/index')}" title="" class="show_signup"> 点击登录</a></h1>
                </div> -->
                <div class="fr-ps  py-4">
                    <h1>第三方登录？
                        <a href=""> <i class="fa fa-qq px-2 text-blue" aria-hidden="true"></i></a>
                        <a href=""> <i class="fa fa-weixin px-2 text-blue" aria-hidden="true"></i></a>
                    </h1>
                </div>
            </div>
        </section>
    </div>
    <include file="public@scripts" />
    <script>
        $(function ($data) {
            $('#send-email-code').click(function () {
                let username = $('#username').val();
                $.ajax({
                    url: "{:url('user/VerificationCode/send')}",
                    type: 'post',
                    data: {
                        username: username
                    },
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == '1') {
                            noty({
                                text: data.msg,
                                type: 'success',
                                layout: 'topCenter',
                                modal: true,
                                timeout: 800,
                                callback: {
                                    // afterClose: function () {

                                    //     if (data.url) {
                                    //         //返回带跳转地址
                                    //         window.location.href = data.url;
                                    //     } else {
                                    //         //刷新当前页
                                    //         reloadPage(window);
                                    //     }

                                    // }
                                }
                            }).show();
                        } else if (data.code == '0') {
                            noty({
                                text: data.msg,
                                type: 'error',
                                layout: 'topCenter',
                                modal: true,
                                timeout: 800,
                                callback: {
                                    afterClose: function () {

                                        // if (data.url) {
                                        //     //返回带跳转地址
                                        //     window.location.href = data.url;
                                        // } else {
                                        //     //刷新当前页
                                        //     reloadPage(window);
                                        // }

                                    }
                                }
                            }).show();
                        }
                    }

                });

            })
        })
    </script>
</body>

</html>